package org.lego.biz.task.management.base.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.lego.biz.task.management.base.entity.base.EmberLinks;
import org.lego.biz.task.management.base.entity.base.UUIDWithTimeAndStatusEntity;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

/**
 * Created by hr.qjy on 16/11/15.
 * 项目
 */
@Entity
@Table(name = "biz_project")
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@AllArgsConstructor
public class Project extends UUIDWithTimeAndStatusEntity implements EmberLinks {
    private String name;        // 项目名称
    private String type;        // 项目类型 待定
    private String description; // 项目描述
    @OneToOne
    @JoinColumn(name = "module_id")
    private TaskModule taskModule;       // 任务模块

    //@Override
    public ConcurrentMap<String, String> getLinks() {
        ConcurrentMap<String, String> links = new ConcurrentHashMap<String, String>();
        links.put("tasks", "tasks");
        return links;
    }
}
